import { NavLink, Outlet } from "react-router-dom";
import {useSelector} from 'react-redux'
 
// NavLink导航链接
// OutLet子路由的容器
function Root() {
  const value = useSelector(state=>state.counter.value)
  return ( <div>
    <p>全局数据:{value}</p>
    <NavLink to="/login">登录</NavLink> |  <NavLink to="/admin">管理</NavLink> | 
    <NavLink to="/produce/123">产品123</NavLink> |  
     <NavLink to="/produce/abc">产品abc</NavLink>
     <NavLink to="/user?id=1">用户1</NavLink>
     <NavLink to="/user?id=2">用户2</NavLink>
    <Outlet/>
  </div> );
}

export default Root;